<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">确认</h4>
            </div>
            <div class="modal-body">
                是否kill此任务？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" ng-click="ok()">确认</button>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="delayKillModal" tabindex="-1" role="dialog" aria-labelledby="delayKillLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="delayKillLabel">推迟任务自动KILL确认</h4>
            </div>
            <div class="modal-body">
                <form name="form" novalidate>
                    <div class="form-group" ng-class="{'has-error':!vm.delayTime,'has-success':vm.delayTime}">
                        <label style="padding: 0 0 5px">推迟kill时间【秒】</label>
                        <input type="number" class="form-control" name="delayTime" ng-model="vm.delayTime" required/>
                        <span ng-show="!vm.delayTime" class="help-block" >请填写推迟kill时间</span>
                        <span ng-show="vm.p.showNoSelect" class="help-block" >请先勾选后再配置时间</span>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" ng-class="{'disabled':loading}" ng-click="delayKillOk()">确认</button>
            </div>
        </div>
    </div>
</div>

<!--导航栏-->
<div class="row-fluid">
    <div class="navbar no-margin">
        <div class="navbar-inner">
            <ul class="breadcrumb">
                <i class="icon-chevron-left hide-sidebar"><a href='#' title="Hide Sidebar" rel='tooltip'>&nbsp;</a></i>
                <i class="icon-chevron-right show-sidebar" style="display:none;"><a href='#' title="Show Sidebar"
                        rel='tooltip'>&nbsp;</a></i>
                <li>
                    <a href="#/admin">首页</a>
                </li>
                <li class="active">查杀任务管理</li>
            </ul>
        </div>
    </div>
</div>
<div class="pull-convert-alert"></div>

<div class="container-fluid">
    <div style="margin: 10px">
        <div class="row">
            <div>
                <p style="float:right;">查杀规则： 单个实例inst运行时长超过6h的将会进入查杀队列， 可以通过设置“延后处理”进行延后被KILL。</p>
            </div>
            <div class="col-sm-12 col-md-12 main" style="float: right">
                <form class="form-inline">
                    <button type="button" class="btn btn-primary" ng-click="BatchConfirmDelayKill()">延后处理</button>
                    <!-- <div class="form-group">
                        <label for="exampleInputName2">队列</label>
                        <select class="form-control" ng-model="vm.p.queue" id="exampleInputName2">
                            <option value="">ALL</option>
                            <option>root.offline.hdp_lbg_supin.normal</option>
                            <option>root.offline.hdp_lbg_supin.explorer</option>
                            <option>root.offline.hdp_lbg_zhaopin.normal</option>
                            <option>root.offline.hdp_lbg_zhaopin.explorer</option>
                            <option>root.spark.hdp_lbg_supin.spark</option>
                            <option>root.spark.hdp_lbg_zhaopin.spark</option>
                        </select>
                    </div> -->
                    <!-- <button id="refreshTable" type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> 查询</button> -->
                </form>
                <!-- <h3 class="sub-header"
                    style="display:inline-block; font-weight: 700;font-size: 14px;padding: 20px 10px 5px 0;">
                </h3> -->

                <!-- Button to trigger modal -->
                <!-- <a class="btn btn-primary btn-sm" href="#/star/user/permission_config" role="button">新建</a> -->
                
                <div id="toolbar">


                </div>
                <table id="list_table" class="table table-condensed " data-toolbar="#toolbar" data-search="true"
                    data-show-columns="true" data-pagination="true" data-search-align="left" data-buttons-align="left"
                    data-toolbar-align="right" data-side-pagination="client" data-cache="false"
                    data-loading-template="loadingTemplate">
                    <thead>
                        <tr>
                            <th data-field="state" data-checkbox="true"></th>
                            <th data-sortable="true" data-formatter="timeoutTaskOptFormat">操作</th>
                            <th data-field="optStatus" data-formatter="optStatusFmt" data-sortable="true">操作状态</th>
                            <th data-field="delayTime" data-formatter="delayTimeFormat" data-sortable="true">推迟时间</th>
                            <th data-field="appId" data-sortable="true">appid</th>
                            <th data-field="appName" data-sortable="true">任务名称</th>
                            <th data-field="appType" data-sortable="true">任务类型</th>
                            <th data-field="queue" data-sortable="true">运行队列</th>
                            <th data-field="useTime" data-formatter="useTimeFormat" data-sortable="true">运行时长</th>
                            <th data-field="progress" data-formatter="progressFormat" data-sortable="true">进度</th>
                            <th data-field="submitTime" data-formatter="timeFormat" data-sortable="true">提交时间</th>
                            <th data-field="launchTime" data-formatter="timeFormat" data-sortable="true">启动时间</th>
                            <!-- <th data-field="finishedTime" data-formatter="timeFormat" data-sortable="true">完成时间</th> -->
                            <th data-field="container" data-sortable="true" data-align="right">container</th>
                            <th data-field="allocatedVCores" data-sortable="true" data-align="right">核心数</th>
                            <th data-field="allocatedMB" data-formatter="storeFormat" data-sortable="true" data-align="right">内存大小</th>
                            <th data-field="user" data-sortable="true">用户名</th>
                        </tr>
                    </thead>
                </table>

            </div>
        </div>
    </div>
</div>
